#ifndef prs_DataFolders_H
#define prs_DataFolders_H

#include "prs_Data.h"

namespace prs {
///////////////////////////////////////////////////////////////////////////////
struct TDataFolders;
///////////////////////////////////////////////////////////////////////////////

struct TDataFoldersRecord : public TDataTypedRecordBase
{
	TDataFolders &dataFolders;
	//
	TDataFoldersRecord(TDataFolders &DataFolders);
	TDataFoldersRecord(TDataFoldersRecord &DataFoldersRecord);
	//
	void operator = (const TDataFoldersRecord &From) {
		record = From.record;
	}
	//
	virtual TTableId  GetTableId() const;
	virtual TRecordId GetRecordId() const { return record->RecordId;}
	//
	TDataTableRecord *GetDataTableRecord() { return record;}
	//
	TDataFoldersRecord &SetValueName(const svl::TString &Value);
	svl::TString GetValueName();

private:
	TDataTableRecord *record;
	friend TDataFolders;
};

///////////////////////////////////////////////////////////////////////////////

struct TDataFolders : public TDebug
{
	TDataFolders(
	  TDataTables &Tables,
	  const TTableId &TableId
	);
  //
  TDataTable *GetTable() { return table;}
	//
	TDataFoldersRecord AddRecord();
	TDataFoldersRecord GetRecord(int RecordId);

private:
  TDataTables &tables;
  TDataTable *table;
  svl::TString nameFieldId;
  friend TDataFoldersRecord;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
